package com.freight.order.service;

import com.alibaba.fastjson.JSONArray;
import com.freight.core.base.FreightBaseService;
import com.freight.core.common.vo.SearchVo;
import com.freight.order.dto.*;
import com.freight.order.entity.Documentary;
import com.freight.order.entity.OrderOrder;
import com.freight.order.vo.OrderProvinceVo;
import com.freight.order.vo.OrderStateCntVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 货物续期需求接口
 *
 * @author huyingtai
 */
public interface OrderOrderService extends FreightBaseService<OrderOrder, Long> {

    JSONArray vehicleListDispatch(Long goodsId, String goodsTypae, String goodsSubTypae, String vehicleState, String range);

    JSONArray companyVehicleListDispatch(Long goodsId, String goodsTypae, String goodsSubTypae, String vehicleState, String range);

    JSONArray vehicleListPosition(String goodsTypae, String goodsSubTypae, String vehicleState, String areaCode);

    JSONArray companyVehicleListPosition(String goodsTypae, String goodsSubTypae, String vehicleState, String areaCode);

    Map getOrderProvinceVo(String orderNo);

    OrderProvinceVo addMobileTrack(Long orderId,String lat,String lon,String mobileModel);


    void circulationRecord(String content,Long operationId);


    /**
     * 平台端 --- 修改结算单
     * @param orderId
     * @param realGoodWeight
     * @param driverUnitPrice
     */
    void updateStatisticsDetails(String types,Long orderId,  Double transGoodWeight, Double realGoodWeight,  BigDecimal driverUnitPrice,  BigDecimal platformUnitPrice,BigDecimal oilcostCargo,BigDecimal etcCargo,

                                 BigDecimal cargoDamage, BigDecimal shouldKnot,BigDecimal solidKnot,BigDecimal adjustment,String addReduce,String adjustmentremarks,
                                 BigDecimal cargoOwnerAdjustment,String cargoOwnerAddReduce,String cargoOwnerAdjustmentremarks);




    /**
     * 获取跟单记录
     * @return
     */
    List<Documentary> getDocumentaryList(Long orderId);

    /**
     * 添加跟单记录
     * @param documentaryDto
     */
    void addDocumentary(DocumentaryDto documentaryDto);

    /**
     * 多条件分页获取
     *
     * @param orderOrder
     * @param searchVo
     * @param pageable
     * @return
     */
    Page<OrderOrder> findByCondition(OrderOrder orderOrder, SearchVo searchVo, Pageable pageable);


    /**
     * 根据订单id流转订单状态
     *
     * @param orderStatusDto
     * @return
     */
    String changeOrderState(OrderStatusDto orderStatusDto);

    /**
     *
     * @param goodId
     * @return
     */
    OrderOrder getByGoodId(Long goodId);
    /**
     *
     * @param orderNo
     * @return
     */
    OrderOrder getByOrderNo(String orderNo);
    /**
     *
     * @param
     */
    void genOrder(PcQuotationDto pcQuotationDto);

    void updateAddressFence(String addressFence,Long orderId);


    /**
     * @param file
     * @param orderReceiptPic
     * @param orderId
     */
    String uploadReceiptOrderPicId(MultipartFile file, String orderReceiptPic, Long orderId, String address, Double lng,Double lat);
    /**
     *
     * @param orderInfoDto
     * @return
     */
    String uploadOrderInfo(OrderAmtDto orderInfoDto);
    /**
     *
     * @param orderIds
     * @return
     */
    List<OrderOrder> getOrderByIds(Long[] orderIds);
    /**
     *
     * @return
     */
    List<OrderStateCntVo> getUserOrderCntVo();
}